package com.vains.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.vains.entity.OauthUser;
import com.vains.mapper.OauthUserMapper;
import com.vains.service.IOauthUserService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author vains
 * @since 2021-03-17
 */
@Service
public class OauthUserServiceImpl extends ServiceImpl<OauthUserMapper, OauthUser> implements IOauthUserService {

    @Override
    public OauthUser loadUserByUsername(String username) {
        return baseMapper.selectOne(Wrappers.lambdaQuery(OauthUser.class).eq(OauthUser::getUserPhone, username).or().eq(OauthUser::getUserNumber, username));
    }
}
